package org.university.repository;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import org.university.entity.Course;

@Repository
public interface CourseRepository extends JpaRepository<Course, String> {
    Page<Course> findByDeletedFalse(Pageable pageable);

    boolean existsByCourseId(String courseId);

    // @Query(value = "SELECT * FROM course WHERE course_id = :courseId", nativeQuery = true)
    Course findByCourseId(String courseId);
}